package net.lab1024.sa.base.common.enumeration;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

/**Interaction
 * @author PC
 */
@Getter
public enum BooleanType implements EnumReturn<Integer> {
    FALSE(0, "否"),
    TRUE(1, "是");
    @EnumValue
    private final int value;
    private final String desc;



    BooleanType(final int value, final String desc) {
        this.value = value;
        this.desc = desc;
    }
    public static BooleanType getByValue(int value) {
        for (BooleanType obj : BooleanType.values()) {
            if (obj.getValue() == value) {
                return obj;
            }
        }
        return null;
    }
    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String toString() {
        return "{" +
                "value:" + value +
                ", desc:'" + desc + '\'' +
                '}';
    }
}
